home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso / commercial / inovatronics / candodemo / testdrivemanual / testdrive2.doc < prev    next >
Text File  |  1994-11-17  |  17KB  |  414 lines

  1. **** CANDO TEST DRIVE #2
  2.  
  3.     Now that you've completed the first Test Drive, you have learned
  4. to create objects, such as Buttons and Fields, and to tell them to do
  5. something.  Now it's time to put this basic knowledge to work by
  6. making a real application.
  7.  
  8.     You are going to make a movie database.  To assist in making
  9. database applications, CanDo comes with a Deck called "DBBaseDeck".
  10. It contains "Routines" which are useful for making many kinds of
  11. databases.  While these routines are not very complicated, in this
  12. tutorial we won't go into detail on how they work.  However, you don't
  13. need to know much about them to make use of them.  You can use them
  14. like the Editor Tools in the first Text Drive.
  15.  
  16.     So let's get started by loading "DBBaseDeck".  You are going to be
  17. using a Menu option to load the Deck.  Therefore, click on some part
  18. of the Main Panel which does not have a Button.  Now, using the right
  19. mouse button, select "Open..." from the Deck Menu.
  20.  
  21.     This will bring up the File Requester.  Click on DBBaseDeck in the
  22. File List and then select Ok.
  23.  
  24.     This will open a plain looking window.  This deck only contains a
  25. single card which does not have any Objects.
  26.  
  27. The Process for making this application is:
  28.  
  29.     · Define the picture window.
  30.     · Make a couple of buttons for moving around in the database.
  31.        (i.e. Next Entry, Previous Entry, Add Entry)
  32.     · Make a couple of "database" Objects.
  33.     · Test it out a little.
  34.     · Add the remaining operations
  35.        (Search, Delete, Sort, Load and Save)
  36.  
  37.     First, let's make your window little more jazzy.  Select the
  38. Window Icon from the Main Panel.
  39.  
  40.     See Picture "Images/WindowIcon"
  41.  
  42.     Click on the Dimension Button and then the "Unnamed" Picture
  43. Button.  Now select "MovieBackdrop.Pic" and click Ok on the File
  44. Requester, Dimension Requester and finally the Window Editor.
  45.  
  46.     This will bring up a window similar to the one used in the first
  47. Test Drive but with some nice titles and imagery.  Now to add the
  48. buttons which allow you to move through the database entries.
  49.  
  50.     The first button will cause the database to move to the the
  51. previous entry.  It will use the same yellow arrow used in the first
  52. Test Drive.  Click on Add and then the Button Icon on the Main Panel.
  53.  
  54.     See Picture "Images/AddIcon"
  55.     See Picture "Images/ButtonIcon"
  56.  
  57.     Position the cross-hairs to the left of the brown box at the
  58. coordinates 15,50 , click and release the left mouse button.
  59.  
  60.     The button you are creating will cause the database to move
  61. backwards to the previous entry.  In this application you are going to
  62. give names to the Objects you create.  Change "Button#1" to "Previous
  63. Button".
  64.  
  65.     See Picture "Images/Name.PreviousButton"
  66.  
  67.     Click on the box next to "Image" and then the "Unnamed" Image Name
  68. Button.  Select "left1.br" by double-clicking it in the File List
  69. (Some people find this easier than selecting the file and clicking
  70. Ok).  Click Ok on the Image Button Requester to return to the Button
  71. Editor.  Click on the "COMPLEMENT" Highlight Button and then the
  72. "Undefined" button to select the alternate image for this button.
  73. Select "left2.br" and return to the Highlight Style Requester.  Click
  74. Ok to return to the Button Editor.
  75.  
  76.     Click on the Release Button to bring up the Script Editor.  The
  77. DBBaseDeck contains the Routines necessary for creating this, and many
  78. other database applications.  To access them, select "Routines..."
  79. from the "Special" Menu.
  80.  
  81.     This will bring up the Routine Browser.
  82.  
  83.     See Picture "Images/RoutineBrowser"
  84.  
  85.     From the list of Routine names, select "Previous Entry" by
  86. clicking on it once.  Then, click the "Insert a 'Do' to this Routine"
  87. Button.  This will create the following line.
  88.  
  89.     Do "Previous Entry"
  90.  
  91.     Click Ok to return to the Button Editor, and then Ok again to
  92. return to the Main Panel.
  93.  
  94.     Now you are going to do a similar process for creating the button
  95. which will cause the database to move the next entry.  Click on the
  96. Add and Button Icons on the Main Panel.  Position the cross-hairs at
  97. 60,50 and click and release the mouse button.  When the Button Editor
  98. appears, change "Button#1" to "Next Button".  Click on the box next to
  99. Image, and then the "Unnamed" buttons.  Select "right1.br" and return
  100. to the Button Editor.  Change the Highlight from "COMPLEMENT" to
  101. "right2.br".  Next, click on the Release button to go to the Script
  102. Editor.  Select "Routines..." from the Special Menu.  This time click
  103. on "Next Entry" and then "Insert a 'Do' to this Routine".
  104.  
  105.     Do "Next Entry"
  106.  
  107.     Exit the Script Editor and then the Button Editor by clicking
  108. their Ok buttons.
  109.  
  110.     Next you will add a Text button below the two arrows which will
  111. "Add" new entries to the database.  Click on Add and then the Button
  112. Icons.  Position the cross-hairs at 20,75, click and release the mouse
  113. button (text buttons get their size from the text).
  114.  
  115.     Change "Button#1" to "Add Button".  Click on the box next to Text
  116. to bring up the Font/Text Requester.  Change "Add Button" to " Add ".
  117. Make sure there are two space on both sides of "Add".  Because the
  118. Text buttons conform to the size of the Text, the spaces will make the
  119. button longer.
  120.  
  121.     See Picture "Images/Text.Add"
  122.  
  123.     Click on Yellow in the Color Palette and then the Shadowed button.
  124. Click Ok to return to the Button Editor
  125.  
  126.     Click on the "OUTLINE" Border Button.  Click on the Shadow style
  127. and Ok to return to the Button Editor.
  128.  
  129.     Click on the Release Button to go to the Script Editor.  Using the
  130. Routine Browser, insert a 'Do' to the "Add Entry" routine.
  131.  
  132.     Do "Add Entry"
  133.  
  134.     Exit the Script Editor and then the Button Editor.
  135.  
  136.     You've created the essential operations to add and look at
  137. database entries.  Now you need to make some "database" fields to use.
  138. In this application you are going to add a "Name" text field, a
  139. "Tape#" integer (number) field, and a "Description" document.  (These
  140. will be easy!)
  141.  
  142.     Click on the Add and Field Icons on the Main Panel.
  143.  
  144.     See Picture "Images/AddIcon"
  145.     See Picture "Images/FieldIcon"
  146.  
  147.     Position the cross-hairs at 230,52.  Press and hold the left mouse
  148. button.  Drag the mouse to the right until the width is 320 and
  149. release the mouse button.
  150.  
  151.     To make this a database field, set the Name Field to ".Name".
  152.  
  153.     See Picture "Images/Name.Name"
  154.  
  155.     When you want a Field, Document, or Button to be included in the
  156. database, the name must begin with ".", followed by a letter, and then
  157. as many letters or numeric characters (0 - 9) as you want.  (The name
  158. cannot contain spaces.) That's all you do to designate a database
  159. object.
  160.  
  161.     Click on the OUTLINE Border button and change it to the new Double
  162. Border style and click Ok.
  163.  
  164.     This Field has a Width of 320.  This leaves room for 40 characters
  165. (320 ÷ 8 pixels per character).  Click on the box, containing a
  166. checkmark, next to the title Text.
  167.  
  168.     See Picture "Images/TextCheckmark"
  169.  
  170.     This brings up the Text Requester.  Change the "Max Number of
  171. Characters" to 40.
  172.  
  173.     See Picture "Images/MaxChars"
  174.  
  175.     Click Ok on the Text Requester.  Click Ok on the Field Editor
  176. Requester to return to the Main Panel.
  177.  
  178.     Click on the Add and Field Icons.  Position the cross-hairs at
  179. 230,70.  Press-Drag the mouse to the right until the Width is 80 and
  180. release the mouse button.  When the Field Editor appears, change the
  181. Name to ".Number".
  182.  
  183.     See Picture "Images/Name.Number"
  184.  
  185.     Click on the Box next to Integer.
  186.  
  187.     See Picture "Images/IntegerBox"
  188.  
  189.     This changes the Field into an Integer Field.  This restricts the
  190. field to only containing numeric values.  This requester allows you to
  191. specify limits for these values and the initial value.  Change Minimum
  192. to 0.
  193.  
  194.     See Picture "Images/MinimumVal"
  195.  
  196.     Click Ok to return to the Field Editor.  Change the Border to the
  197. new Double Border Style.  Click Ok on the Field Editor to return to
  198. the Main Panel.
  199.  
  200.     Finally, let's add the Description Document.  Click on the Add and
  201. the Document Icons on the Main Panel.
  202.  
  203.     See Picture "Images/AddIcon"
  204.     See Picture "Images/DocumentIcon"
  205.  
  206.     Position the cross-hairs at 230,88.  Press-Drag the mouse to make
  207. the dimensions 320,64 and then release the mouse pointer.
  208.  
  209.     Set the Name to ".Description" and the Document to "Description - Doc"
  210.  
  211.     See Picture "Images/Name.Description"
  212.  
  213.     The first Test Drive used the Document Field to spec